<template>
  <div id="wrap">
    <Scrolltop></Scrolltop>
    <!--头部-->
    <div class="top">

      <img @click="goback()" class="top-back" src="../../../static/bmqd/BMQD-1.png" alt="">
      <span>{{title}}</span>
      <img @click="show()" class="top-fenxiang" src="../../../static/bmqd/BMQD-3.png" alt="">

      <div class="top-fx" v-if="bol">
        <div id="test"></div>
        <ul>
          <router-link to="/info"><li><img src="../../../static/bmqd/xiaoxi.png" alt="">消息</li></router-link>
          <router-link to="/"><li><img src="../../../static/bmqd/shouye.png" alt="">首页</li></router-link>
          <router-link to="/fenxiang"><li><img src="../../../static/bmqd/fx.png" alt="">分享</li></router-link>
          <router-link to="/mine"><li><img src="../../../static/bmqd/mine.png" alt="">个人中心</li></router-link>

        </ul>
      </div>
    </div>

    <div class="content" v-for="i in arr">
      <div class="top-img">
        <router-link to="/milk">
          <img :src="i.src" alt="">
          <p>{{i.text}}</p>
        </router-link>
      </div>

      <div class="wrap" >
        <div class="milk-img">
          <div class="milk-info" v-for="item in i.info">
            <router-link to="/milk">
              <div class="mf-top">
                <img :src="item.url" alt="">
              </div>
            </router-link>
            <div class="mf-bottom">
              <h3>{{item.tit}}</h3>
              <span>{{item.price}}</span>
            </div>
          </div>
        </div>
      </div>
    </div>

  </div>
</template>

<script>
  import Scrolltop from './Scrolltop'
    export default {
        name: "Bimai",
      data(){
          return{
            title:'必买清单',
            bol:false,
            arr:[
              {src:require('../../../static/bmqd/BMQD-4.png'),
                text:'奶粉也要玩有机，养成健康北鼻',
                info:[
                  {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥59'},
                  {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥129'},
                  {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥88'}
                ]
              },
              {src:require('../../../static/bmqd/BMQD-4.png'),
                text:'奶粉也要玩有机，养成健康北鼻',
                info:[
                  {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥59'},
                  {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥129'},
                  {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥88'}
                ]
              },
              {src:require('../../../static/bmqd/BMQD-4.png'),
                text:'奶粉也要玩有机，养成健康北鼻',
                info:[
                  {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥59'},
                  {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥129'},
                  {url:require('../../../static/bmqd/BMQD-5.png'),tit:'诺优能幼儿配 方奶粉',price:'¥88'}
                ]
              }
            ],

          }
      },
      components:{
        Scrolltop
      },
      methods:{
          show(){
            this.bol=!this.bol;
          },
          goback(){
            window.history.go(-1);
          }
      }
    }
</script>

<style scoped>
  #wrap{
    background: #f2f2f2;
    position: relative;
  }


  .top{
    position: relative;
    width: 69rem;
    height: 3rem;
    line-height: 3rem;
    padding: 3.5rem 1.5rem;
    background: #e53e42;
    display: flex;
    justify-content: space-between;
  }
  .top-back{
    width: 3rem;
    height: 3rem;
  }
  .top-fenxiang{
    width: 4rem;
    height: 1rem;
    margin-top: 1rem;
  }
  .top span{
    font-size: 3.6rem;
    color: #fff;
  }
  .top-fx{
    position: absolute;
    top: 9rem;
    right: 2rem;
    width: 18rem;
    height: 28rem;
    background: #fff;
    border-radius: 2rem;
    z-index: 500;
  }
  #test{
    position: absolute;
    top: -3.8rem;
    right: 2rem;
    width:0;
    height:0;
    border:2rem solid;
    border-color:transparent transparent #fff transparent;
  }
  .top-fx ul{
    width: 14rem;
    height: 24rem;
    padding: 2rem 2rem;
  }
  .top-fx ul li{
    width: 100%;
    height: 6rem;
    font-size: 2.4rem;
    color: #333;
  }
  .top-fx ul li img{
    width: 3rem;
    height: 3rem;
    vertical-align: middle;
    margin-right: 1rem;
  }


  .top-img{
    position: relative;
    width: 72rem;
    height: 40rem;
  }
  .top-img p{
    position: absolute;
    left: 0;
    bottom: 7rem;
    width: 100%;
    height: 8rem;
    line-height: 8rem;
    font-size: 3rem;
    color: #fff;
    background: rgba(0,0,0,0.3);
    text-align: center;

  }
  .top-img img{
    width: 100%;
    height: 100%;
  }

  .wrap{
    padding:2rem ;
    background: #fff;
    margin-bottom: 2rem;
  }
  .wrap p{
    font-size: 2.8rem;
    color: #4d4d4d;
    margin-bottom: 6rem;
  }
  .milk-img{
    width: 100%;
    display: flex;
    justify-content: space-between;
    /*background: #f00;*/
  }
  .milk-info{
    width: 22rem;
    /*height: 34rem;*/
    /*background: #f00;*/
    margin-bottom: 1rem;
  }
  .mf-top{
    width: 16rem;
    height: 15rem;
    padding:2rem 3rem;
    border: 1px solid #ccc;
  }
  .mf-top img{
    width: 15rem;
    height: 15rem;
  }
  .mf-bottom{
    padding: 1rem 2rem 1rem;
    text-align: center;
  }
  .mf-bottom h3{
    text-align: left;
    font-size: 2.2rem;
    color: #4d4d4d;
  }
  .mf-bottom span{
    display: block;
    color: #e53e42;
    font-size: 2.4rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
</style>
